<script lang="ts" setup>
import { GeneralModelService } from '@/tool/GeneralModelService.ts'

defineProps<{
    onBeforeOk?: () => void | Promise<any>
}>()

const { isShow, show, hide } = new GeneralModelService()

defineExpose({
    show,
    hide,
})

</script>

<template>
<div>

    <div @click="show">
        <slot name="trigger" />
    </div>

    <a-modal
            v-model:visible="isShow"
            :on-before-ok="onBeforeOk"
            draggable
            v-bind="$attrs"
            @cancel="hide"
    >
        <slot />
    </a-modal>
</div>
</template>

<style lang="scss" scoped>

</style>
